<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>添加/编辑文章 - Powered By ${systemConfig.systemName}</title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="${base}/template/assets/i/favicon.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="${base}/template/assets/i/app-icon72x72@2x.png">

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="${base}/template/assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">

  <link rel="stylesheet" href="${base}/res/css/amazeui.min.css">
  <link rel="stylesheet" href="${base}/res/css/app.css">
  <link rel="stylesheet" href="${base}/res/css/admin.css">
  <script src="${base}/res/js/jquery.min.js"></script>
  <!-- 百度编辑器 -->
  <script type="text/javascript" charset="utf-8" src="${base}/res/plugins/ueditor/ueditor.config.js"></script>
  <script type="text/javascript" charset="utf-8" src="${base}/res/plugins/ueditor/ueditor.all.min.js"> </script>
  <script type="text/javascript" charset="utf-8" src="${base}/res/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
  <%
	var isAdd = false;
	var isEdit = false;
	if(isEmpty(article.id)){
		isAdd = true;
	}else{
		isEdit = true;
  }%>
</head>
<body>
<!--在这里编写你的代码-->
<div class="admin-content">
	 <div class="am-cf am-padding">
	   <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">商品管理</strong> / <small><%if(isAdd){%>添加文章<%}else{%>编辑文章<%}%></small></div>
	 </div>
	 <hr style="padding:0px 1.6rem 1.6rem 1rem;margin:0px;">
	 <div class="am-g" >
		<div class="am-u-sm-12" style="padding:0px 5px 0px 0px;margin:0px;height: 950px">
		    <form id="inputForm" class="am-form" action="<%if (isAdd){%>${base}/article/save<%}else{%>${base}/article/update<%}%>" method="post">
	          <input type="hidden" name="article.id" value="${article.id!}" />
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">文章标题</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" name="article.title" class="am-input-sm" value="${article.title!}" required/>
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${titleMessages!}</div>
	          </div>
	
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">文章分类</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
	             <select name="article.articleCategory_id" data-am-selected="{btnSize: 'sm', btnStyle: 'secondary'}" >
					<%for(list in articleCategoryTreeList){%>
						<option value="${list.id}"<%if (list.id == article.articleCategory_id!){%> selected<%}%>>
							<%if (list.level != 0){%>
								<%for( i in range(0,list.level!0)){%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%}%>
							<%}%>
						${list.name}
						</option>
					<%}%>
				</select>
	            </div>
	             <div class="am-hide-sm-only am-u-md-6 am-text-warning">${articleCategoryIdMessages!}</div>
	          </div>
	
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">作者</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" class="am-input-sm" name="article.author" value="${article.author!}" />
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${urlMessages!}</div>
	          </div>
	
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">排序</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" name="brand.orderList" class="am-input-sm" value="${brand.orderList!50}" title="只允许输入零或正整数" required/>
	            </div>
	            <div class="am-u-sm-12 am-u-md-6 am-text-warning">${orderListMessages!}</div>
	          </div>
	
			  <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right" style="margin-top:0.8rem">是否推荐</div>
	            <div class="am-u-sm-8 am-u-md-4">
	            	<div class="am-g">
					  <div class="am-u-sm-2"><label class="am-radio am-secondary"><input type="radio" name="article.isRecommend" value="true" data-am-ucheck<%if (article.isRecommend! == true){%> checked<%}%>> 是</label></div>
					  <div class="am-u-sm-10"><label class="am-radio am-secondary"><input type="radio" name="article.isRecommend" value="false" data-am-ucheck<%if (isAdd || article.isRecommend! == false){%> checked<%}%>> 否</label></div>
					</div>
	            </div>
	             <div class="am-hide-sm-only am-u-md-6 am-text-warning">${isRecommendMessages!}</div>
	          </div>
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right" style="margin-top:0.8rem">是否置顶</div>
	            <div class="am-u-sm-8 am-u-md-4">
	            	<div class="am-g">
					  <div class="am-u-sm-2"><label class="am-radio am-secondary"><input type="radio" name="article.isTop" value="true" data-am-ucheck<%if (article.isTop! == true){%> checked<%}%>> 是</label></div>
					  <div class="am-u-sm-10"><label class="am-radio am-secondary"><input type="radio" name="article.isTop" value="false" data-am-ucheck<%if (isAdd || article.isTop! == false){%> checked<%}%>> 否</label></div>
					</div>
	            </div>
	             <div class="am-hide-sm-only am-u-md-6 am-text-warning">${isTopMessages!}</div>
	          </div>
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right" style="margin-top:0.8rem">是否发布</div>
	            <div class="am-u-sm-8 am-u-md-4">
	            	<div class="am-g">
					  <div class="am-u-sm-2"><label class="am-radio am-secondary"><input type="radio" name="article.isPublication" value="true" data-am-ucheck<%if (isAdd || article.isPublication! == true){%> checked<%}%>> 是</label></div>
					  <div class="am-u-sm-10"><label class="am-radio am-secondary"><input type="radio" name="article.isPublication" value="false" data-am-ucheck<%if (article.isPublication! == false){%> checked<%}%>> 否</label></div>
					</div>
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${isPublicationMessages!}</div>
	          </div>
	          
	           <div class="am-g am-margin-top-sm">
	            <div class="am-u-sm-12 am-u-md-1 am-text-right admin-form-text">内容</div>
	            <div class="am-u-sm-12 am-u-md-10">
	               <script id="editor" name="article.content" type="text/plain"  style="width: 70%;height:240px;">${article.content!}</script>
	            </div>
	            <div class="am-hide-sm-only am-u-md-6 am-text-warning">${contentMessages!}</div>
	          </div>
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">页面关键词</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <input type="text" class="am-input-sm" name="article.metaKeywords" value="${article.metaKeywords!}" />
	            </div>
	            <div class="am-u-sm-12 am-u-md-6 am-text-warning">${orderListMessages!}</div>
	          </div>
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-1 am-text-right">页面描述</div>
	            <div class="am-u-sm-8 am-u-md-4">
	              <textarea name="article.metaDescription" class="am-input-sm" >${article.metaDescription!}</textarea>
	            </div>
	            <div class="am-u-sm-12 am-u-md-6 am-text-warning">${orderListMessages!}</div>
	          </div>
	          
			  <div class="am-g am-margin-top" style="">
			  <div class="am-u-sm-12 am-u-md-1 am-text-right admin-form-text"></div>
			  <div class="am-u-sm-12 am-u-md-11">
			  	<button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
			    <button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="window.history.back(); return false;">放弃保存</button>
			  </div>
			  </div>
	        </form>
		</div>
	</div>
</div>
<!-- content end -->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${base}/res/js/amazeui.min.js"></script>
<script type="text/javascript">
	var ue = UE.getEditor('editor');//初始化
</script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<![endif]-->
</body>
</html>
